﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataBaseLibrary.DBInterfaces;


namespace DataBaseLibrary.DBObjectsFB
{
    public class Buyers : DBFObject, IDBObject 
    {
        private int m_Individual_index = 0;
        public Individual m_Individual
        {
            get;
            set;
        }


        public Buyers()
        {
            m_Individual = new Individual();
            NameTable = "BUYERS_TABLE";
        }

        public object Save()
        {
            Parameters = new Dictionary<string, object>();
            Parameters.Add("ID_INDIVIDUAL_TABLE", (m_Individual as IDBObject).Save());
            return SaveObject();
        }

        public void Load(object ID)
        {
            Parameters = new Dictionary<string, object>();
            Parameters.Add("ID_INDIVIDUAL_TABLE", m_Individual_index);

            LoadObject(ID);

            m_Individual = new Individual();
            (m_Individual as IDBObject).Load(Parameters["ID_INDIVIDUAL_TABLE"]);
        }

        public void Update()
        {
            (m_Individual as IDBObject).Update();
        }
    }
}
